import javax.swing.*;
import java.awt.*;

public class GuessPanel extends JPanel {

	// the number of guesses allowed per game
	final int NUM_COLUMNS = 10;
	GuessColumn guessColumns[];

	public GuessPanel() {
		this.setLayout(new GridLayout(1, NUM_COLUMNS));
		guessColumns = new GuessColumn[NUM_COLUMNS];

		for (int i = 0; i < NUM_COLUMNS; i++) {
			guessColumns[i] = new GuessColumn();
		}

		// add the guess columns to the panel
		for (int i = 0; i < NUM_COLUMNS; i++) {
			add(guessColumns[i]);
		}
	}

	// methods below call the method sin the GuessColumn class
	public int[] getValues(int column) {
		return guessColumns[column].getValues();
	}

	public void setClickable(int i, boolean value) {
		guessColumns[i].Clickable(value);
	}

	public void setPegs(int pegSet, int[] values) {
		guessColumns[pegSet].setPegValues(values);
	}

	public void clear() {
		for (int i = 0; i < NUM_COLUMNS; i++) {
			guessColumns[i].clear();
			guessColumns[i].Clickable(false);
		}
	}
}
